import request from '@/utils/request'

export function checkConnection(params) {
    return request({
        url: '/uReport/datasource/test',
        method: 'post',
        data: params
    })
}

export function addDruid(params) {
    return request({
        url: '/uReport/datasource/add',
        method: 'post',
        data: params
    })
}

export function editDruid(params) {
    return request({
        url: '/uReport/datasource/update',
        method: 'post',
        data: params
    })
}

export function removeDruid(params) {
    return request({
        url: '/uReport/datasource/delete',
        method: 'post',
        params: params
    })
}

export function selectDruidByPrimaryKey(params) {
    return request({
        url: '/uReport/datasource/select',
        method: 'post',
        params: params
    })
}

export function selectBuildinDruidList() {
    return request({
        url: '/uReport/datasource/selectBuildinDruidList',
        method: 'post',
    })
}

export function selectDruidTableList(params) {
    return request({
        url: '/uReport/datasource/tableList',
        method: 'post',
        data: params
    })
}

export function selectDruidTableFieldList(params) {
    return request({
        url: '/uReport/datasource/tableFieldList',
        method: 'post',
        data: params
    })
}

export function springbeanFieldList(params) {
    return request({
        url: '/uReport/datasource/springbeanFieldList',
        method: 'post',
        params: params
    })
}


export function tableDataList(params) {
    return request({
        url: '/uReport/datasource/tableDataList',
        method: 'post',
        params: params
    })
}

export function previewData(params) {
    return request({
        url: '/uReport/datasource/preview',
        method: 'post',
        data: params
    })
}

export function testConnection(params) {
    return request({
        url: '/uReport/datasource/testConnection',
        method: 'post',
        data: params
    })
}

export function previewApiData(params) {
    return request({
        url: '/uReport/datasource/api',
        method: 'post',
        data: params
    })
}
